<%@ page session="false" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
<html>
	<head>
		<title><fmt:message key="form.title.2"/></title>
    	<link rel="stylesheet" type="text/css"  href="css/common.css" />


    <!--[if lt IE 5.5000]><style type="text/css">@import "css/IE50Fixes.css"; @import "css css/skinIE55Fixes.css";</style><![endif]-->
    <!--[if IE 5.5000]><style type="text/css">@import "css/IE55Fixes.css"; @import "css/skinIE55Fixes.css";</style><![endif]-->
    <!--[if gte IE 6]><style type="text/css">@import "css/IE60Fixes.css"; @import "css/skinIE60Fixes.css";</style><![endif]-->
    
		<script type="text/javascript">
			function valida(){
				var error="";
				var subject = document.getElementById("subject");
				if (subject.value==""){
					error="<fmt:message key='form.val.subject'/>\n";
				}
				
				var body = document.getElementById("body");
				if (body.value.indexOf("$AMIGO")==-1){
					error+="<fmt:message key='form.val.body'/>";
				}
				
				if (body.value.length>150){
					error+="<fmt:message key='form.val.bodylength'/>";				
				}
				if (error=="") return true;
				
				alert(error);
				return false;							
			}
		</script>
	</head>
	<body class="ns-0">
        <div id="globalWrapper">
      <div class="bar">&nbsp;</div>
        <div id="content">
		<h1 class="firstHeading"><fmt:message key="form.welcome"/></h1>
        <div id="column-content">
	<div id="bodyContent">
	    <div id="contentSub"></div>
	
		
	    	<div style="border: 1px solid #6eb927; padding: .7em; background-color:#ecf2e6; margin-top: 0;">
			<fmt:message key="form.step2"/>
		</div>

		<form method="post" onsubmit="return valida();">
		<spring:bind path="amigo">
			<ul>
				<c:forEach items="${status.errorMessages}" var="errorMessage">
					<li style="color:red"><c:out value="${errorMessage}"/></li>
				</c:forEach>
			</ul>
		</spring:bind>
		
		<table id="main" style="border: 1px solid #aaa; margin: 0; padding: 0; width: 100%;">
			<tr>
				<td style="vertical-align:top; width: 70%; padding-right: .6em;">
					<div class="hp_box">
					<table>					
		
						<tr>
							<td colspan="4" style="padding: 10pt"><label><fmt:message key="form.instr.msg"/></label></td>
						</tr>
		
						<tr>
							<td style="font-size: 90%;"><label><fmt:message key="form.msg.subject"/></label></td>
							<spring:bind path="amigo.subject">
								<td colspan="3"><input type="text" size="45" maxlength="45" name="subject" id="subject" value='<fmt:message key="form.msg.subject.default"/>'/></td>
								<td><a href="faq.html#inst" target="faq"><img src="help.gif"/></a></td>
							</spring:bind>
						</tr>
		
						<tr>
							<td style="font-size: 90%;"><label><fmt:message key="form.msg.body"/></label></td>
							<spring:bind path="amigo.body">
								<td colspan="3"><textarea rows="3" cols="45" name="body" id="body" /><fmt:message key="form.msg.body.default"/></textarea></td>
							</spring:bind>
						</tr>
		
					</table>
					</div>
				</td>
			</tr>	
			<tr>
				<td>
					<table id="submit">	
						<tr>
							<td colspan="2" align="center"><input type="submit" value="<fmt:message key="form.prev"/>" name="_target0"/></td>
							<td colspan="2" align="center"><input type="submit" value="<fmt:message key="form.next"/>" name="_target2"/></td>
						</tr>							
					</table>
				</td>
			</tr>
		</table>
			
		</form>		
		<%@ include file="footer.jsp" %>
			</div>
			</div>
			</div>
			</div>
		
	</body>
</html>